Homework 1

Author

Christine Raj

Adding libraries and packages

library(data.table)
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.3     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::between()     masks data.table::between()
✖ dplyr::filter()      masks stats::filter()
✖ dplyr::first()       masks data.table::first()
✖ lubridate::hour()    masks data.table::hour()
✖ lubridate::isoweek() masks data.table::isoweek()
✖ dplyr::lag()         masks stats::lag()
✖ dplyr::last()        masks data.table::last()
✖ lubridate::mday()    masks data.table::mday()
✖ lubridate::minute()  masks data.table::minute()
✖ lubridate::month()   masks data.table::month()
✖ lubridate::quarter() masks data.table::quarter()
✖ lubridate::second()  masks data.table::second()
✖ purrr::transpose()   masks data.table::transpose()
✖ lubridate::wday()    masks data.table::wday()
✖ lubridate::week()    masks data.table::week()
✖ lubridate::yday()    masks data.table::yday()
✖ lubridate::year()    masks data.table::year()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(leaflet)
library(lubridate)
library(ggplot2)

Uploading data

part2002 <- data.table::fread(file.path("~", "Downloads", "ad_viz_plotval_data.csv"))
part2022 <- data.table::fread(file.path("~", "Downloads", "ad_viz_plotval_data (1).csv"))

Looking through 2002 Data

dim(part2002)
[1] 15976    20
head(part2002)
         Date Source  Site ID POC Daily Mean PM2.5 Concentration    UNITS
1: 01/05/2002    AQS 60010007   1                           25.1 ug/m3 LC
2: 01/06/2002    AQS 60010007   1                           31.6 ug/m3 LC
3: 01/08/2002    AQS 60010007   1                           21.4 ug/m3 LC
4: 01/11/2002    AQS 60010007   1                           25.9 ug/m3 LC
5: 01/14/2002    AQS 60010007   1                           34.5 ug/m3 LC
6: 01/17/2002    AQS 60010007   1                           41.0 ug/m3 LC
   DAILY_AQI_VALUE Site Name DAILY_OBS_COUNT PERCENT_COMPLETE
1:              78 Livermore               1              100
2:              92 Livermore               1              100
3:              71 Livermore               1              100
4:              80 Livermore               1              100
5:              98 Livermore               1              100
6:             115 Livermore               1              100
   AQS_PARAMETER_CODE       AQS_PARAMETER_DESC CBSA_CODE
1:              88101 PM2.5 - Local Conditions     41860
2:              88101 PM2.5 - Local Conditions     41860
3:              88101 PM2.5 - Local Conditions     41860
4:              88101 PM2.5 - Local Conditions     41860
5:              88101 PM2.5 - Local Conditions     41860
6:              88101 PM2.5 - Local Conditions     41860
                           CBSA_NAME STATE_CODE      STATE COUNTY_CODE  COUNTY
1: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
2: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
3: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
4: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
5: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
6: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
   SITE_LATITUDE SITE_LONGITUDE
1:      37.68753      -121.7842
2:      37.68753      -121.7842
3:      37.68753      -121.7842
4:      37.68753      -121.7842
5:      37.68753      -121.7842
6:      37.68753      -121.7842
tail(part2002)
         Date Source  Site ID POC Daily Mean PM2.5 Concentration    UNITS
1: 12/10/2002    AQS 61131003   1                             15 ug/m3 LC
2: 12/13/2002    AQS 61131003   1                             15 ug/m3 LC
3: 12/22/2002    AQS 61131003   1                              1 ug/m3 LC
4: 12/25/2002    AQS 61131003   1                             23 ug/m3 LC
5: 12/28/2002    AQS 61131003   1                              5 ug/m3 LC
6: 12/31/2002    AQS 61131003   1                              6 ug/m3 LC
   DAILY_AQI_VALUE            Site Name DAILY_OBS_COUNT PERCENT_COMPLETE
1:              57 Woodland-Gibson Road               1              100
2:              57 Woodland-Gibson Road               1              100
3:               4 Woodland-Gibson Road               1              100
4:              74 Woodland-Gibson Road               1              100
5:              21 Woodland-Gibson Road               1              100
6:              25 Woodland-Gibson Road               1              100
   AQS_PARAMETER_CODE       AQS_PARAMETER_DESC CBSA_CODE
1:              88101 PM2.5 - Local Conditions     40900
2:              88101 PM2.5 - Local Conditions     40900
3:              88101 PM2.5 - Local Conditions     40900
4:              88101 PM2.5 - Local Conditions     40900
5:              88101 PM2.5 - Local Conditions     40900
6:              88101 PM2.5 - Local Conditions     40900
                                 CBSA_NAME STATE_CODE      STATE COUNTY_CODE
1: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
2: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
3: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
4: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
5: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
6: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
   COUNTY SITE_LATITUDE SITE_LONGITUDE
1:   Yolo      38.66121      -121.7327
2:   Yolo      38.66121      -121.7327
3:   Yolo      38.66121      -121.7327
4:   Yolo      38.66121      -121.7327
5:   Yolo      38.66121      -121.7327
6:   Yolo      38.66121      -121.7327
str(part2002)
Classes 'data.table' and 'data.frame':  15976 obs. of  20 variables:
 $ Date                          : chr  "01/05/2002" "01/06/2002" "01/08/2002" "01/11/2002" ...
 $ Source                        : chr  "AQS" "AQS" "AQS" "AQS" ...
 $ Site ID                       : int  60010007 60010007 60010007 60010007 60010007 60010007 60010007 60010007 60010007 60010007 ...
 $ POC                           : int  1 1 1 1 1 1 1 1 1 1 ...
 $ Daily Mean PM2.5 Concentration: num  25.1 31.6 21.4 25.9 34.5 41 29.3 15 18.8 37.9 ...
 $ UNITS                         : chr  "ug/m3 LC" "ug/m3 LC" "ug/m3 LC" "ug/m3 LC" ...
 $ DAILY_AQI_VALUE               : int  78 92 71 80 98 115 87 57 65 107 ...
 $ Site Name                     : chr  "Livermore" "Livermore" "Livermore" "Livermore" ...
 $ DAILY_OBS_COUNT               : int  1 1 1 1 1 1 1 1 1 1 ...
 $ PERCENT_COMPLETE              : num  100 100 100 100 100 100 100 100 100 100 ...
 $ AQS_PARAMETER_CODE            : int  88101 88101 88101 88101 88101 88101 88101 88101 88101 88101 ...
 $ AQS_PARAMETER_DESC            : chr  "PM2.5 - Local Conditions" "PM2.5 - Local Conditions" "PM2.5 - Local Conditions" "PM2.5 - Local Conditions" ...
 $ CBSA_CODE                     : int  41860 41860 41860 41860 41860 41860 41860 41860 41860 41860 ...
 $ CBSA_NAME                     : chr  "San Francisco-Oakland-Hayward, CA" "San Francisco-Oakland-Hayward, CA" "San Francisco-Oakland-Hayward, CA" "San Francisco-Oakland-Hayward, CA" ...
 $ STATE_CODE                    : int  6 6 6 6 6 6 6 6 6 6 ...
 $ STATE                         : chr  "California" "California" "California" "California" ...
 $ COUNTY_CODE                   : int  1 1 1 1 1 1 1 1 1 1 ...
 $ COUNTY                        : chr  "Alameda" "Alameda" "Alameda" "Alameda" ...
 $ SITE_LATITUDE                 : num  37.7 37.7 37.7 37.7 37.7 ...
 $ SITE_LONGITUDE                : num  -122 -122 -122 -122 -122 ...
 - attr(*, ".internal.selfref")=<externalptr> 
table(part2002$Date)

01/01/2002 01/02/2002 01/03/2002 01/04/2002 01/05/2002 01/06/2002 01/07/2002 
        18        102         18         19         83         19         19 
01/08/2002 01/09/2002 01/10/2002 01/11/2002 01/12/2002 01/13/2002 01/14/2002 
        99         21         19         73         20         16        104 
01/15/2002 01/16/2002 01/17/2002 01/18/2002 01/19/2002 01/20/2002 01/21/2002 
        20         19         83         18         17        108         18 
01/22/2002 01/23/2002 01/24/2002 01/25/2002 01/26/2002 01/27/2002 01/28/2002 
        17         75         17         18        115         18         18 
01/29/2002 01/30/2002 01/31/2002 02/01/2002 02/02/2002 02/03/2002 02/04/2002 
        76         21         13        112         17         16         77 
02/05/2002 02/06/2002 02/07/2002 02/08/2002 02/09/2002 02/10/2002 02/11/2002 
        21         22        120         21         20         83         16 
02/12/2002 02/13/2002 02/14/2002 02/15/2002 02/16/2002 02/17/2002 02/18/2002 
        20        111         20         23         84         21         21 
02/19/2002 02/20/2002 02/21/2002 02/22/2002 02/23/2002 02/24/2002 02/25/2002 
       112         16         20         85         21         21        114 
02/26/2002 02/27/2002 02/28/2002 03/01/2002 03/02/2002 03/03/2002 03/04/2002 
        19         21         83         23         20        113         20 
03/05/2002 03/06/2002 03/07/2002 03/08/2002 03/09/2002 03/10/2002 03/11/2002 
        17         82         19         20        124         23         21 
03/12/2002 03/13/2002 03/14/2002 03/15/2002 03/16/2002 03/17/2002 03/18/2002 
        86         22         21        119         24         20         80 
03/19/2002 03/20/2002 03/21/2002 03/22/2002 03/23/2002 03/24/2002 03/25/2002 
        22         21        117         22         20         83         20 
03/26/2002 03/27/2002 03/28/2002 03/29/2002 03/30/2002 03/31/2002 04/01/2002 
        20        115         18         22         88         21         16 
04/02/2002 04/03/2002 04/04/2002 04/05/2002 04/06/2002 04/07/2002 04/08/2002 
       114         15         16         67         16         17        117 
04/09/2002 04/10/2002 04/11/2002 04/12/2002 04/13/2002 04/14/2002 04/15/2002 
        15         20         73         15         12        119         16 
04/16/2002 04/17/2002 04/18/2002 04/19/2002 04/20/2002 04/21/2002 04/22/2002 
        18         68         12         14        124         15         14 
04/23/2002 04/24/2002 04/25/2002 04/26/2002 04/27/2002 04/28/2002 04/29/2002 
        75         16         14        122         17         15         73 
04/30/2002 05/01/2002 05/02/2002 05/03/2002 05/04/2002 05/05/2002 05/06/2002 
        17         15        115         12         16         71         13 
05/07/2002 05/08/2002 05/09/2002 05/10/2002 05/11/2002 05/12/2002 05/13/2002 
        15        119         14         13         76         16         15 
05/14/2002 05/15/2002 05/16/2002 05/17/2002 05/18/2002 05/19/2002 05/20/2002 
       123         16         16         69         15         15        119 
05/21/2002 05/22/2002 05/23/2002 05/24/2002 05/25/2002 05/26/2002 05/27/2002 
        15         17         73         16         15        119         18 
05/28/2002 05/29/2002 05/30/2002 05/31/2002 06/01/2002 06/02/2002 06/03/2002 
        14         69         15         16        125         16         16 
06/04/2002 06/05/2002 06/06/2002 06/07/2002 06/08/2002 06/09/2002 06/10/2002 
        76         16         15        122         16         16         71 
06/11/2002 06/12/2002 06/13/2002 06/14/2002 06/15/2002 06/16/2002 06/17/2002 
        15         17        121         16         18         71         15 
06/18/2002 06/19/2002 06/20/2002 06/21/2002 06/22/2002 06/23/2002 06/24/2002 
        17        119         17         14         74         15         15 
06/25/2002 06/26/2002 06/27/2002 06/28/2002 06/29/2002 06/30/2002 07/01/2002 
       126         16         20         71         16         16        118 
07/02/2002 07/03/2002 07/04/2002 07/05/2002 07/06/2002 07/07/2002 07/08/2002 
        16         19         74         18         17        121         16 
07/09/2002 07/10/2002 07/11/2002 07/12/2002 07/13/2002 07/14/2002 07/15/2002 
        15         70         17         16        120         18         16 
07/16/2002 07/17/2002 07/18/2002 07/19/2002 07/20/2002 07/21/2002 07/22/2002 
        72         15         16        125         19         16         68 
07/23/2002 07/24/2002 07/25/2002 07/26/2002 07/27/2002 07/28/2002 07/29/2002 
        18         16        119         18         19         67         18 
07/30/2002 07/31/2002 08/01/2002 08/02/2002 08/03/2002 08/04/2002 08/05/2002 
        14        111         16         15         68         15         14 
08/06/2002 08/07/2002 08/08/2002 08/09/2002 08/10/2002 08/11/2002 08/12/2002 
       110         13         16         68         17         15        114 
08/13/2002 08/14/2002 08/15/2002 08/16/2002 08/17/2002 08/18/2002 08/19/2002 
        16         16         58         12         15        107         14 
08/20/2002 08/21/2002 08/22/2002 08/23/2002 08/24/2002 08/25/2002 08/26/2002 
        13         65         13         10        113         14         13 
08/27/2002 08/28/2002 08/29/2002 08/30/2002 08/31/2002 09/01/2002 09/02/2002 
        63         14         17        113         15         15         64 
09/03/2002 09/04/2002 09/05/2002 09/06/2002 09/07/2002 09/08/2002 09/09/2002 
        13         14        121         14         14         73         13 
09/10/2002 09/11/2002 09/12/2002 09/13/2002 09/14/2002 09/15/2002 09/16/2002 
        14        119         14         15         73         13         14 
09/17/2002 09/18/2002 09/19/2002 09/20/2002 09/21/2002 09/22/2002 09/23/2002 
       120         16         15         74         15         13        118 
09/24/2002 09/25/2002 09/26/2002 09/27/2002 09/28/2002 09/29/2002 09/30/2002 
        16         15         75         14         13        121         14 
10/01/2002 10/02/2002 10/03/2002 10/04/2002 10/05/2002 10/06/2002 10/07/2002 
        15         79         19         17        119         19         17 
10/08/2002 10/09/2002 10/10/2002 10/11/2002 10/12/2002 10/13/2002 10/14/2002 
        84         20         20        114         21         20         82 
10/15/2002 10/16/2002 10/17/2002 10/18/2002 10/19/2002 10/20/2002 10/21/2002 
        19         19        117         17         20         87         17 
10/22/2002 10/23/2002 10/24/2002 10/25/2002 10/26/2002 10/27/2002 10/28/2002 
        19        122         19         21         83         18         19 
10/29/2002 10/30/2002 10/31/2002 11/01/2002 11/02/2002 11/03/2002 11/04/2002 
       119         21         19         84         18         19        112 
11/05/2002 11/06/2002 11/07/2002 11/08/2002 11/09/2002 11/10/2002 11/11/2002 
        20         21         83         21         20        113         18 
11/12/2002 11/13/2002 11/14/2002 11/15/2002 11/16/2002 11/17/2002 11/18/2002 
        18         81         18         21        116         19         18 
11/19/2002 11/20/2002 11/21/2002 11/22/2002 11/23/2002 11/24/2002 11/25/2002 
        85         22         23        115         22         20         73 
11/26/2002 11/27/2002 11/28/2002 11/29/2002 11/30/2002 12/01/2002 12/02/2002 
        20         19        115         24         26         82         19 
12/03/2002 12/04/2002 12/05/2002 12/06/2002 12/07/2002 12/08/2002 12/09/2002 
        21        117         20         23         82         18         16 
12/10/2002 12/11/2002 12/12/2002 12/13/2002 12/14/2002 12/15/2002 12/16/2002 
       114         21         18         81         17         16        104 
12/17/2002 12/18/2002 12/19/2002 12/20/2002 12/21/2002 12/22/2002 12/23/2002 
        18         19         80         17         19        110         17 
12/24/2002 12/25/2002 12/26/2002 12/27/2002 12/28/2002 12/29/2002 12/30/2002 
        23         88         21         18        119         23         21 
12/31/2002 
        91 
table(part2002$Source)

  AQS 
15976 
table(part2002$`Site ID`)

60010007 60011001 60070002 60074001 60090001 60111002 60130002 60150002 
      96      105      120      353       60       95      276      110 
60170011 60170012 60179000 60190008 60195001 60195025 60199000 60231002 
      93        2      113      499       86       91       84       59 
60250003 60250005 60251003 60270101 60271003 60290010 60290011 60290014 
      85      165       92      115      162       91      100     1295 
60290015 60290016 60299002 60310004 60333001 60370002 60371002 60371103 
     104      117       93       83       61      339      122      365 
60371201 60371301 60371601 60372005 60374002 60379033 60379034 60410002 
     120      122      118      121      356      107      109       97 
60430003 60431001 60450006 60472510 60490001 60519000 60531003 60570005 
     116      174      122       89        2      111      120       50 
60571001 60590007 60592022 60610006 60631006 60631009 60651003 60652002 
     176      351      119       60       77      100      115      117 
60655001 60658001 60659000 60670006 60670010 60674001 60690003 60710025 
     119      562      104      285      380      154      119      111 
60710306 60712002 60718001 60719002 60719004 60719010 60730001 60730003 
     225      118       56       96      117      112      116      416 
60730006 60731002 60731007 60750005 60771002 60792002 60798001 60811001 
     111      355      352      196      124       52      116      100 
60831008 60839000 60850004 60850005 60852003 60870007 60890004 60893003 
      60       92      141      101      217       61       54      104 
60893004 60893005 60930005 60950004 60970003 60990005 61010003 61059000 
      54       59      104       97       93      183      114       90 
61071001 61072002 61110007 61110009 61112002 61113001 61131003 
     104      404      156      117      169      114      112 
table(part2002$POC)

    1     2     3     4     5     6 
12450   847  1086   331  1033   229 
summary(part2002$`Daily Mean PM2.5 Concentration`)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00    7.00   12.00   16.12   20.50  104.30 
table(part2002$`Daily Mean PM2.5 Concentration`)

    0   0.1   0.2   0.3   0.4   0.5   0.6   0.7   0.8   0.9     1   1.1   1.2 
    3     7    18    23    19    28    31    21    30    35    74    32    28 
  1.3   1.4   1.5   1.6   1.7   1.8   1.9     2   2.1   2.2   2.3   2.4   2.5 
   25    24    29    25    43    29    38    97    26    45    36    39    32 
  2.6   2.7   2.8   2.9     3   3.1   3.2   3.3   3.4   3.5   3.6   3.7   3.8 
   37    38    42    40   167    43    44    46    29    48    46    51    49 
  3.9     4   4.1   4.2   4.3   4.4   4.5   4.6   4.7   4.8   4.9     5   5.1 
   52   227    41    61    60    54    62    66    49    49    57   267    55 
  5.2   5.3   5.4   5.5   5.6   5.7   5.8   5.9     6   6.1   6.2   6.3   6.4 
   63    58    66    62    55    53    63    55   332    44    64    54    57 
  6.5   6.6   6.7   6.8   6.9     7   7.1   7.2   7.3   7.4   7.5   7.6   7.7 
   57    45    61    63    51   309    65    53    70    48    63    63    71 
  7.8   7.9     8   8.1   8.2   8.3   8.4   8.5   8.6   8.7   8.8   8.9     9 
   58    55   302    51    63    49    43    65    55    56    61    73   290 
  9.1   9.2   9.3   9.4   9.5   9.6   9.7   9.8   9.9    10  10.1  10.2  10.3 
   66    55    51    54    78    57    49    72    49   249    57    68    54 
 10.4  10.5  10.6  10.7  10.8  10.9    11  11.1  11.2  11.3  11.4  11.5  11.6 
   62    56    52    50    56    51   217    62    47    51    49    71    50 
 11.7  11.8  11.9    12  12.1  12.2  12.3  12.4  12.5  12.6  12.7  12.8  12.9 
   55    58    39   209    46    54    53    40    54    42    45    62    50 
   13  13.1  13.2  13.3  13.4  13.5  13.6  13.7  13.8  13.9    14  14.1  14.2 
  190    50    47    55    45    61    53    49    45    40   177    47    43 
 14.3  14.4  14.5  14.6  14.7  14.8  14.9    15  15.1  15.2  15.3  15.4  15.5 
   38    42    49    38    57    46    48   138    40    43    50    38    45 
 15.6  15.7  15.8  15.9    16  16.1  16.2  16.3  16.4  16.5  16.6  16.7  16.8 
   47    46    39    38   129    35    34    37    36    36    32    35    29 
 16.9    17  17.1  17.2  17.3  17.4  17.5  17.6  17.7  17.8  17.9    18  18.1 
   34   105    28    33    23    46    36    31    29    31    26    79    27 
 18.2  18.3  18.4  18.5  18.6  18.7  18.8  18.9    19  19.1  19.2  19.3  19.4 
   28    37    21    32    25    48    35    23    88    36    34    29    28 
 19.5  19.6  19.7  19.8  19.9    20  20.1  20.2  20.3  20.4  20.5  20.6  20.7 
   31    21    27    31    20    85    24    21    20    23    26    22    18 
 20.8  20.9    21  21.1  21.2  21.3  21.4  21.5  21.6  21.7  21.8  21.9    22 
   33    24    70    17    26    26    24    31    13    23    20    24    62 
 22.1  22.2  22.3  22.4  22.5  22.6  22.7  22.8  22.9    23  23.1  23.2  23.3 
   15    21    24    21    27    31    23    27    12    68    20    25    20 
 23.4  23.5  23.6  23.7  23.8  23.9    24  24.1  24.2  24.3  24.4  24.5  24.6 
   14    18    29    19    20    13    55    17    20    11    13    24    23 
 24.7  24.8  24.9    25  25.1  25.2  25.3  25.4  25.5  25.6  25.7  25.8  25.9 
   15    17    13    40    14    12    19    12    25     9    22    15    23 
   26  26.1  26.2  26.3  26.4  26.5  26.6  26.7  26.8  26.9    27  27.1  27.2 
   31    17    24    21    15    29    11    20    25    12    48    16    12 
 27.3  27.4  27.5  27.6  27.7  27.8  27.9    28  28.1  28.2  28.3  28.4  28.5 
   24     3    11    15    11    13     8    42    14    11    11     8    16 
 28.6  28.7  28.8  28.9    29  29.1  29.2  29.3  29.4  29.5  29.6  29.7  29.8 
    7    12    10    11    21    13    12    12    10    13    11     9    18 
 29.9    30  30.1  30.2  30.3  30.4  30.5  30.6  30.7  30.8  30.9    31  31.1 
   12    23    11    14     7    12    11     9     7    11     6    24     9 
 31.2  31.3  31.4  31.5  31.6  31.7  31.8  31.9    32  32.1  32.2  32.3  32.4 
    3    13     7    15     8    12     8    12    31    10     2    10    15 
 32.5  32.6  32.7  32.8  32.9    33  33.1  33.2  33.3  33.4  33.5  33.6  33.7 
   12    12     8    10     5    30     6     9     9     8     5     9     3 
 33.8  33.9    34  34.1  34.2  34.3  34.4  34.5  34.6  34.7  34.8  34.9    35 
   12     4    31    10     9     8     7    11     6    11     5     5    20 
 35.1  35.2  35.3  35.4  35.5  35.6  35.7  35.8  35.9    36  36.1  36.2  36.3 
    6    13     1     7     6    13     6    15     8    17    10    10     9 
 36.4  36.5  36.6  36.7  36.8  36.9    37  37.1  37.2  37.3  37.4  37.5  37.6 
    3     8     6     7     7     8    15     3    12     7     6     2     4 
 37.7  37.8  37.9    38  38.1  38.2  38.3  38.4  38.5  38.6  38.7  38.8  38.9 
    6     3     4    25     9     9     2     4     4     4     6     9     3 
   39  39.1  39.2  39.3  39.4  39.5  39.6  39.7  39.8  39.9    40  40.1  40.2 
   13     6     6     7     4     9     9     5     5     6    16     5     5 
 40.3  40.4  40.5  40.6  40.7  40.8  40.9    41  41.1  41.2  41.3  41.4  41.5 
    5     2     9     7     6     5     3    16     4     6     6     5     6 
 41.6  41.7  41.8  41.9    42  42.1  42.2  42.3  42.4  42.5  42.6  42.7  42.8 
    5     8     4     4    22     2     6     7     3     4     1     7     9 
 42.9    43  43.1  43.2  43.3  43.4  43.5  43.6  43.7  43.8  43.9    44  44.1 
    8    18     3     1     2     5     7     3     6     4     3    10     9 
 44.2  44.3  44.4  44.5  44.6  44.7  44.8  44.9    45  45.1  45.2  45.3  45.4 
    4     7     2     6     4     5     4     3    16     4     7     5     2 
 45.5  45.6  45.7  45.8  45.9    46  46.1  46.2  46.3  46.4  46.5  46.6  46.7 
    5     3     3     5     1    17     2     1     7     4     4     4     4 
 46.8  46.9    47  47.1  47.2  47.3  47.4  47.5  47.6  47.7  47.8  47.9    48 
    5     4     7     4     3     6     3     5     3     5     4     2    12 
 48.1  48.3  48.4  48.5  48.7  48.8  48.9    49  49.1  49.2  49.3  49.4  49.5 
    6     2     7     2     6     4     5    10     1     5     1     7     5 
 49.6  49.7  49.9    50  50.1  50.2  50.3  50.4  50.5  50.6  50.7  50.8  50.9 
    2     6     2    13     2     1     4     2     5     1     3     1     2 
   51  51.1  51.2  51.3  51.4  51.5  51.6  51.7  51.8    52  52.1  52.2  52.3 
   10     2     5     9     3     1     4     3     3     2     4     1     5 
 52.4  52.5  52.6  52.7  52.8  52.9    53  53.1  53.2  53.3  53.4  53.5  53.6 
    3     4     4     1     4     3    12     2     6     3     3     4     6 
 53.7  53.9    54  54.1  54.3  54.4  54.5  54.6  54.7  54.8  54.9    55  55.1 
    4     1    10     1     2     6     1     4     2     4     1     3     6 
 55.2  55.3  55.4  55.6  55.7  55.8    56  56.1  56.3  56.5  56.6  56.7  56.8 
    6     4     3     2     1     1     8     2     5     3     3     3     3 
 56.9    57  57.1  57.2  57.3  57.4  57.5  57.6  57.7  57.8  57.9    58  58.1 
    4     9     2     3     3     6     2     2     5     1     1     7     2 
 58.2  58.4  58.5  58.6  58.7  58.8  58.9    59  59.2  59.3  59.4  59.5  59.6 
    3     2     3     5     1     3     2     7     4     1     2     3     2 
 59.7    60  60.2  60.5  60.8  60.9    61  61.1  61.4  61.6  61.7  61.8  61.9 
    5     6     1     1     2     2     8     1     1     3     2     3     2 
   62  62.1  62.2  62.3  62.5  62.6  62.7    63  63.3  63.5  63.6  63.7  63.8 
    9     2     1     1     1     2     1     7     1     1     1     2     1 
 63.9    64  64.1  64.3  64.4  64.5  64.6  64.7  64.8  64.9    65  65.1  65.2 
    4     7     2     1     3     1     1     2     2     1     7     3     2 
 65.3  65.4  65.7    66  66.2  66.3  66.6  66.8  66.9    67  67.2  67.3  67.6 
    2     1     1     7     3     5     1     2     1     3     1     1     2 
 67.7  67.8  67.9    68  68.1  68.2  68.6  68.7  68.8    69  69.1  69.2  69.6 
    3     2     1     5     2     1     1     4     2     6     1     1     3 
 69.7  69.9    70  70.1  70.2  70.3  70.5  70.8  70.9    71  71.1  71.2  71.3 
    2     2     2     1     1     1     1     1     2     3     3     1     1 
 71.7  71.8  71.9    72  72.3  72.4  72.9    73  73.1  73.2  73.5  73.6  73.9 
    1     3     1     3     1     2     1     5     2     2     1     1     2 
   74  74.4  74.7    75  75.1  75.3  75.5  75.7  75.8    76  76.1  76.3  76.4 
    2     1     1     2     2     1     1     1     1     4     1     1     2 
 76.6  76.7  76.8  76.9    77  77.2  77.4  77.6    78  78.1  78.3  78.5  79.3 
    1     1     1     1     3     2     1     1     1     2     1     1     1 
 79.5    80  80.3  80.4  80.7  80.9    81  81.1  81.3  81.6    82  82.1    83 
    1     2     1     1     2     1     1     1     1     1     3     1     2 
 83.1  83.9    84  84.1  84.2  84.4  84.6    85  85.3  85.6  85.7    86  86.2 
    1     1     2     1     2     1     1     1     1     2     1     1     1 
 86.6    87  87.4  87.5    88  88.6  89.3  89.6  89.8  90.7    91  91.7  92.5 
    1     2     1     1     1     1     1     1     1     1     2     1     1 
 93.9 102.7 104.3 
    1     1     1 
summary(part2002$DAILY_AQI_VALUE)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00   29.00   50.00   53.68   69.00  176.00 
table(part2002$DAILY_AQI_VALUE)

  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19 
 10  41  47  82 109  85  53  68 164  71 107  75  82 254  75 145 101 268 175 128 
 20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39 
155 322 121 183 116 431 118 114 169 360 188 111 134 415 114 157 111 134 411 105 
 40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59 
184 121 306 184 108 157 279  98 170 113 248 153 243 337 263 352 224 272 223 287 
 60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79 
175 203 166 196 145 131 215 130 173  99 163 111 146 102 152 100 125  86  84  77 
 80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 
108 100 105  66  89  60  40  68  63  67  38  55  50  65  47  60  34  66  32  47 
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 
 21  25  50  30  28  37  18  41  19  22  32  27  32  21  21  32  24  38  15  42 
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 
 11  20  26  19  28  18  16  21  19  20  16  17  20  11  26  18  10  20  11  15 
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 
 18  10  12  12  21  16  11  13  13  14  13  19  64  45  37  31  34  30  27  20 
160 161 162 163 164 165 166 167 168 169 170 171 175 176 
 18  14  19   7  11   7  10   9   4   5   2   1   1   1 
table(part2002$`Site Name`)

                                                  
                                              230 
                          3425 N FIRST ST, FRESNO 
                                              499 
                               Alturas-Fourth St. 
                                                2 
                                          Anaheim 
                                              351 
                            Aqua Tibia Wilderness 
                                              104 
                       Atascadero (original site) 
                                              116 
                                            Azusa 
                                              339 
                      Bakersfield-Airport (Planz) 
                                              117 
                           Bakersfield-California 
                                             1295 
                        Bakersfield-Golden / M St 
                                               91 
                                         Big Bear 
                                               56 
                                         Bliss SP 
                                              113 
                             Brawley-401 Main St. 
                                               85 
                                          Burbank 
                                              122 
                            Calexico-Ethel Street 
                                              165 
                             Chico-Manzanita Ave. 
                                              120 
                                      Chula Vista 
                                              116 
                                     Clovis-Villa 
                                               86 
                              Colusa-Sunrise Blvd 
                                               95 
                                          Concord 
                                              276 
                               Corcoran-Patterson 
                                               83 
                   Death Valley NP - Park Village 
                                              115 
                                      Echo Summit 
                                                2 
                                         El Cajon 
                                              416 
                             El Centro-9th Street 
                                               92 
                        El Rio-Rio Mesa School #2 
                                              114 
                                        Escondido 
                                              355 
                                  Eureka I Street 
                                               59 
                                          Fontana 
                                              118 
                             Fremont - Chapel Way 
                                              105 
                                   Fresno-Pacific 
                                               91 
                     Grass Valley-Litton Building 
                                               50 
                                Hoover Wilderness 
                                              111 
                                            Indio 
                                              117 
                      Joshua Tree NP - Black Rock 
                                               96 
                                Kaiser Wilderness 
                                               84 
                                      Kearny Mesa 
                                              111 
                                           Keeler 
                                              162 
                          Lakeport-Lakeport Blvd. 
                                               61 
                        Lancaster-Division Street 
                                              107 
 Lassen Volcanic NP - Manzanita Lake Fire Station 
                                              104 
                      Lava Beds National Monument 
                                              104 
                                            Lebec 
                                              109 
                          Lebec-Peace Valley Road 
                                               93 
                                        Livermore 
                                               96 
                               Long Beach (North) 
                                              356 
                    Los Angeles-North Main Street 
                                              365 
                                          Lynwood 
                                              122 
                                      Merced-M St 
                                               89 
                                    Mission Viejo 
                                              119 
                              Modesto-14th Street 
                                              183 
                                           Mojave 
                                              100 
                             Ontario Fire Station 
                                              111 
                                     Palm Springs 
                                              119 
                                         Pasadena 
                                              121 
Pinnacles NP - Southwest of East Entrance Station 
                                              119 
                                   Piru - Pacific 
                                              117 
                    Point Reyes NS Ranger Station 
                                               97 
                        Portola-161 Nevada Street 
                                              100 
                           Quincy-N Church Street 
                                               77 
                                Redding - Buckeye 
                                               54 
                      Redding - Health Department 
                                               54 
                                  Redding - Toyon 
                                               59 
                                     Redwood City 
                                              100 
                                       Redwood NP 
                                              110 
                                           Reseda 
                                              120 
                        Ridgecrest-California Ave 
                                              104 
                             Riverside (Magnolia) 
                                              115 
                          Roseville-N Sunrise Ave 
                                               60 
                                         Rubidoux 
                                              562 
      Sacramento Health Department-Stockton Blvd. 
                                              154 
                         Sacramento-1309 T Street 
                                              380 
                        Sacramento-Del Paso Manor 
                                              285 
                                        Salinas 3 
                                              120 
                     San Andreas-Gold Strike Road 
                                               60 
                                   San Bernardino 
                                              117 
                               San Diego-12th Ave 
                                              352 
                                    San Francisco 
                                              196 
                                         San Jose 
                                              217 
                               San Jose - 4th St. 
                                              141 
                               San Jose - Jackson 
                                              101 
                        San Luis Obispo-Marsh St. 
                                               52 
                            San Rafael Wilderness 
                                               92 
                                       Santa Cruz 
                                               61 
                                      Santa Maria 
                                               60 
                              Santa Rosa - 5th St 
                                               93 
                          Sequoia NP-Ash Mountain 
                                              104 
                       Simi Valley-Cochran Street 
                                              169 
                       South Lake Tahoe-Sandy Way 
                                               93 
                                Stockton-Hazelton 
                                              124 
                                    Thousand Oaks 
                                              156 
                        TRAFFIC, RURAL PAVED ROAD 
                                              353 
                                          Trinity 
                                               90 
                             Truckee-Fire Station 
                                              176 
                                    Ukiah-Library 
                                              122 
                                          Vallejo 
                                               97 
                          Victorville-Park Avenue 
                                              225 
                                   Visalia-Church 
                                              404 
                             Woodland-Gibson Road 
                                              112 
                    Yosemite NP - Turtleback Dome 
                                              116 
       Yosemite NP-Yosemite Village Vistor Center 
                                              174 
                                        Yuba City 
                                              114 
summary(part2002$DAILY_OBS_COUNT)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      1       1       1       1       1       1 

The dataset has 15976 observations and 20 variables. There are no NA’s and there was at least one value taken once per day throughout all of 2002 at one of the sites. There were no missed days. The data was collected from counties all across California. The median daily AQI value was 50.00 while the mean was 53.68. The daily median PM2.5 is 12.00 and the mean is 16.12. There are no NAs in this dataset.

Looking through 2022 Data

dim(part2022)
[1] 56140    20
head(part2022)
         Date Source  Site ID POC Daily Mean PM2.5 Concentration    UNITS
1: 01/01/2022    AQS 60010007   3                           12.7 ug/m3 LC
2: 01/02/2022    AQS 60010007   3                           13.9 ug/m3 LC
3: 01/03/2022    AQS 60010007   3                            7.1 ug/m3 LC
4: 01/04/2022    AQS 60010007   3                            3.7 ug/m3 LC
5: 01/05/2022    AQS 60010007   3                            4.2 ug/m3 LC
6: 01/06/2022    AQS 60010007   3                            3.8 ug/m3 LC
   DAILY_AQI_VALUE Site Name DAILY_OBS_COUNT PERCENT_COMPLETE
1:              52 Livermore               1              100
2:              55 Livermore               1              100
3:              30 Livermore               1              100
4:              15 Livermore               1              100
5:              18 Livermore               1              100
6:              16 Livermore               1              100
   AQS_PARAMETER_CODE       AQS_PARAMETER_DESC CBSA_CODE
1:              88101 PM2.5 - Local Conditions     41860
2:              88101 PM2.5 - Local Conditions     41860
3:              88101 PM2.5 - Local Conditions     41860
4:              88101 PM2.5 - Local Conditions     41860
5:              88101 PM2.5 - Local Conditions     41860
6:              88101 PM2.5 - Local Conditions     41860
                           CBSA_NAME STATE_CODE      STATE COUNTY_CODE  COUNTY
1: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
2: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
3: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
4: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
5: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
6: San Francisco-Oakland-Hayward, CA          6 California           1 Alameda
   SITE_LATITUDE SITE_LONGITUDE
1:      37.68753      -121.7842
2:      37.68753      -121.7842
3:      37.68753      -121.7842
4:      37.68753      -121.7842
5:      37.68753      -121.7842
6:      37.68753      -121.7842
tail(part2022)
         Date Source  Site ID POC Daily Mean PM2.5 Concentration    UNITS
1: 12/01/2022    AQS 61131003   1                            3.4 ug/m3 LC
2: 12/07/2022    AQS 61131003   1                            3.8 ug/m3 LC
3: 12/13/2022    AQS 61131003   1                            6.0 ug/m3 LC
4: 12/19/2022    AQS 61131003   1                           34.8 ug/m3 LC
5: 12/25/2022    AQS 61131003   1                           23.2 ug/m3 LC
6: 12/31/2022    AQS 61131003   1                            1.0 ug/m3 LC
   DAILY_AQI_VALUE            Site Name DAILY_OBS_COUNT PERCENT_COMPLETE
1:              14 Woodland-Gibson Road               1              100
2:              16 Woodland-Gibson Road               1              100
3:              25 Woodland-Gibson Road               1              100
4:              99 Woodland-Gibson Road               1              100
5:              74 Woodland-Gibson Road               1              100
6:               4 Woodland-Gibson Road               1              100
   AQS_PARAMETER_CODE       AQS_PARAMETER_DESC CBSA_CODE
1:              88101 PM2.5 - Local Conditions     40900
2:              88101 PM2.5 - Local Conditions     40900
3:              88101 PM2.5 - Local Conditions     40900
4:              88101 PM2.5 - Local Conditions     40900
5:              88101 PM2.5 - Local Conditions     40900
6:              88101 PM2.5 - Local Conditions     40900
                                 CBSA_NAME STATE_CODE      STATE COUNTY_CODE
1: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
2: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
3: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
4: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
5: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
6: Sacramento--Roseville--Arden-Arcade, CA          6 California         113
   COUNTY SITE_LATITUDE SITE_LONGITUDE
1:   Yolo      38.66121      -121.7327
2:   Yolo      38.66121      -121.7327
3:   Yolo      38.66121      -121.7327
4:   Yolo      38.66121      -121.7327
5:   Yolo      38.66121      -121.7327
6:   Yolo      38.66121      -121.7327
str(part2022)
Classes 'data.table' and 'data.frame':  56140 obs. of  20 variables:
 $ Date                          : chr  "01/01/2022" "01/02/2022" "01/03/2022" "01/04/2022" ...
 $ Source                        : chr  "AQS" "AQS" "AQS" "AQS" ...
 $ Site ID                       : int  60010007 60010007 60010007 60010007 60010007 60010007 60010007 60010007 60010007 60010007 ...
 $ POC                           : int  3 3 3 3 3 3 3 3 3 3 ...
 $ Daily Mean PM2.5 Concentration: num  12.7 13.9 7.1 3.7 4.2 3.8 2.3 6.9 13.6 11.2 ...
 $ UNITS                         : chr  "ug/m3 LC" "ug/m3 LC" "ug/m3 LC" "ug/m3 LC" ...
 $ DAILY_AQI_VALUE               : int  52 55 30 15 18 16 10 29 54 47 ...
 $ Site Name                     : chr  "Livermore" "Livermore" "Livermore" "Livermore" ...
 $ DAILY_OBS_COUNT               : int  1 1 1 1 1 1 1 1 1 1 ...
 $ PERCENT_COMPLETE              : num  100 100 100 100 100 100 100 100 100 100 ...
 $ AQS_PARAMETER_CODE            : int  88101 88101 88101 88101 88101 88101 88101 88101 88101 88101 ...
 $ AQS_PARAMETER_DESC            : chr  "PM2.5 - Local Conditions" "PM2.5 - Local Conditions" "PM2.5 - Local Conditions" "PM2.5 - Local Conditions" ...
 $ CBSA_CODE                     : int  41860 41860 41860 41860 41860 41860 41860 41860 41860 41860 ...
 $ CBSA_NAME                     : chr  "San Francisco-Oakland-Hayward, CA" "San Francisco-Oakland-Hayward, CA" "San Francisco-Oakland-Hayward, CA" "San Francisco-Oakland-Hayward, CA" ...
 $ STATE_CODE                    : int  6 6 6 6 6 6 6 6 6 6 ...
 $ STATE                         : chr  "California" "California" "California" "California" ...
 $ COUNTY_CODE                   : int  1 1 1 1 1 1 1 1 1 1 ...
 $ COUNTY                        : chr  "Alameda" "Alameda" "Alameda" "Alameda" ...
 $ SITE_LATITUDE                 : num  37.7 37.7 37.7 37.7 37.7 ...
 $ SITE_LONGITUDE                : num  -122 -122 -122 -122 -122 ...
 - attr(*, ".internal.selfref")=<externalptr> 
table(part2022$Date)

01/01/2022 01/02/2022 01/03/2022 01/04/2022 01/05/2022 01/06/2022 01/07/2022 
       142        175        139        141        194        136        137 
01/08/2022 01/09/2022 01/10/2022 01/11/2022 01/12/2022 01/13/2022 01/14/2022 
       176        139        138        201        140        140        176 
01/15/2022 01/16/2022 01/17/2022 01/18/2022 01/19/2022 01/20/2022 01/21/2022 
       144        143        205        141        145        178        143 
01/22/2022 01/23/2022 01/24/2022 01/25/2022 01/26/2022 01/27/2022 01/28/2022 
       144        201        143        143        177        140        137 
01/29/2022 01/30/2022 01/31/2022 02/01/2022 02/02/2022 02/03/2022 02/04/2022 
       201        142        139        177        145        148        199 
02/05/2022 02/06/2022 02/07/2022 02/08/2022 02/09/2022 02/10/2022 02/11/2022 
       146        146        179        142        141        200        144 
02/12/2022 02/13/2022 02/14/2022 02/15/2022 02/16/2022 02/17/2022 02/18/2022 
       145        181        143        145        202        146        145 
02/19/2022 02/20/2022 02/21/2022 02/22/2022 02/23/2022 02/24/2022 02/25/2022 
       182        145        144        210        145        148        184 
02/26/2022 02/27/2022 02/28/2022 03/01/2022 03/02/2022 03/03/2022 03/04/2022 
       147        147        204        143        144        176        141 
03/05/2022 03/06/2022 03/07/2022 03/08/2022 03/09/2022 03/10/2022 03/11/2022 
       140        204        140        142        179        141        137 
03/12/2022 03/13/2022 03/14/2022 03/15/2022 03/16/2022 03/17/2022 03/18/2022 
       193        136        134        175        140        142        202 
03/19/2022 03/20/2022 03/21/2022 03/22/2022 03/23/2022 03/24/2022 03/25/2022 
       142        142        176        139        139        188        134 
03/26/2022 03/27/2022 03/28/2022 03/29/2022 03/30/2022 03/31/2022 04/01/2022 
       134        171        134        136        191        136        135 
04/02/2022 04/03/2022 04/04/2022 04/05/2022 04/06/2022 04/07/2022 04/08/2022 
       175        140        140        193        140        141        175 
04/09/2022 04/10/2022 04/11/2022 04/12/2022 04/13/2022 04/14/2022 04/15/2022 
       141        141        199        141        138        170        139 
04/16/2022 04/17/2022 04/18/2022 04/19/2022 04/20/2022 04/21/2022 04/22/2022 
       141        198        139        136        174        137        134 
04/23/2022 04/24/2022 04/25/2022 04/26/2022 04/27/2022 04/28/2022 04/29/2022 
       198        136        137        173        138        136        195 
04/30/2022 05/01/2022 05/02/2022 05/03/2022 05/04/2022 05/05/2022 05/06/2022 
       138        137        173        138        139        201        138 
05/07/2022 05/08/2022 05/09/2022 05/10/2022 05/11/2022 05/12/2022 05/13/2022 
       137        172        137        136        191        136        136 
05/14/2022 05/15/2022 05/16/2022 05/17/2022 05/18/2022 05/19/2022 05/20/2022 
       176        141        137        202        140        138        174 
05/21/2022 05/22/2022 05/23/2022 05/24/2022 05/25/2022 05/26/2022 05/27/2022 
       137        137        194        136        140        177        138 
05/28/2022 05/29/2022 05/30/2022 05/31/2022 06/01/2022 06/02/2022 06/03/2022 
       138        204        137        136        175        140        139 
06/04/2022 06/05/2022 06/06/2022 06/07/2022 06/08/2022 06/09/2022 06/10/2022 
       191        141        137        176        140        135        200 
06/11/2022 06/12/2022 06/13/2022 06/14/2022 06/15/2022 06/16/2022 06/17/2022 
       138        141        177        138        136        192        140 
06/18/2022 06/19/2022 06/20/2022 06/21/2022 06/22/2022 06/23/2022 06/24/2022 
       141        178        137        136        198        134        139 
06/25/2022 06/26/2022 06/27/2022 06/28/2022 06/29/2022 06/30/2022 07/01/2022 
       174        138        139        192        139        137        167 
07/02/2022 07/03/2022 07/04/2022 07/05/2022 07/06/2022 07/07/2022 07/08/2022 
       136        132        195        133        135        170        131 
07/09/2022 07/10/2022 07/11/2022 07/12/2022 07/13/2022 07/14/2022 07/15/2022 
       130        185        128        131        165        134        136 
07/16/2022 07/17/2022 07/18/2022 07/19/2022 07/20/2022 07/21/2022 07/22/2022 
       197        140        132        164        129        129        187 
07/23/2022 07/24/2022 07/25/2022 07/26/2022 07/27/2022 07/28/2022 07/29/2022 
       136        137        169        135        136        198        134 
07/30/2022 07/31/2022 08/01/2022 08/02/2022 08/03/2022 08/04/2022 08/05/2022 
       134        167        136        134        188        138        134 
08/06/2022 08/07/2022 08/08/2022 08/09/2022 08/10/2022 08/11/2022 08/12/2022 
       170        134        132        195        136        139        172 
08/13/2022 08/14/2022 08/15/2022 08/16/2022 08/17/2022 08/18/2022 08/19/2022 
       138        137        191        133        133        170        136 
08/20/2022 08/21/2022 08/22/2022 08/23/2022 08/24/2022 08/25/2022 08/26/2022 
       137        200        135        135        170        139        137 
08/27/2022 08/28/2022 08/29/2022 08/30/2022 08/31/2022 09/01/2022 09/02/2022 
       186        140        135        170        138        133        189 
09/03/2022 09/04/2022 09/05/2022 09/06/2022 09/07/2022 09/08/2022 09/09/2022 
       136        134        169        130        134        187        136 
09/10/2022 09/11/2022 09/12/2022 09/13/2022 09/14/2022 09/15/2022 09/16/2022 
       137        169        136        135        189        135        136 
09/17/2022 09/18/2022 09/19/2022 09/20/2022 09/21/2022 09/22/2022 09/23/2022 
       171        136        135        191        136        134        172 
09/24/2022 09/25/2022 09/26/2022 09/27/2022 09/28/2022 09/29/2022 09/30/2022 
       137        137        195        138        140        174        133 
10/01/2022 10/02/2022 10/03/2022 10/04/2022 10/05/2022 10/06/2022 10/07/2022 
       138        192        137        138        171        141        143 
10/08/2022 10/09/2022 10/10/2022 10/11/2022 10/12/2022 10/13/2022 10/14/2022 
       201        141        142        173        141        141        194 
10/15/2022 10/16/2022 10/17/2022 10/18/2022 10/19/2022 10/20/2022 10/21/2022 
       141        144        173        137        137        199        140 
10/22/2022 10/23/2022 10/24/2022 10/25/2022 10/26/2022 10/27/2022 10/28/2022 
       142        176        137        137        186        134        134 
10/29/2022 10/30/2022 10/31/2022 11/01/2022 11/02/2022 11/03/2022 11/04/2022 
       167        135        133        201        139        139        172 
11/05/2022 11/06/2022 11/07/2022 11/08/2022 11/09/2022 11/10/2022 11/11/2022 
       137        139        194        137        140        172        143 
11/12/2022 11/13/2022 11/14/2022 11/15/2022 11/16/2022 11/17/2022 11/18/2022 
       142        202        141        142        171        144        143 
11/19/2022 11/20/2022 11/21/2022 11/22/2022 11/23/2022 11/24/2022 11/25/2022 
       199        143        140        175        139        140        193 
11/26/2022 11/27/2022 11/28/2022 11/29/2022 11/30/2022 12/01/2022 12/02/2022 
       138        142        171        140        142        190        138 
12/03/2022 12/04/2022 12/05/2022 12/06/2022 12/07/2022 12/08/2022 12/09/2022 
       139        171        136        137        201        141        138 
12/10/2022 12/11/2022 12/12/2022 12/13/2022 12/14/2022 12/15/2022 12/16/2022 
       177        141        142        198        143        140        169 
12/17/2022 12/18/2022 12/19/2022 12/20/2022 12/21/2022 12/22/2022 12/23/2022 
       138        138        196        139        137        173        138 
12/24/2022 12/25/2022 12/26/2022 12/27/2022 12/28/2022 12/29/2022 12/30/2022 
       139        191        141        135        166        137        136 
12/31/2022 
       186 
table(part2022$Source)

  AQS 
56140 
table(part2022$`Site ID`)

60010007 60010009 60010011 60010012 60010015 60070008 60072002 60074001 
     343      365      364      360      361      410      354      357 
60090001 60110007 60111002 60130002 60131004 60150002 60150007 60179001 
     355       42      359      463      354      120      338      111 
60179002 60190011 60190500 60192008 60192009 60192016 60195001 60195025 
     117      533      339      357      352      357      359      352 
60199000 60210003 60231004 60250005 60250007 60250010 60251003 60270002 
     112      351      116      448      349      235      358      410 
60271003 60271018 60271023 60271033 60290010 60290014 60290016 60290018 
     473      302      352      325      329      712      114      360 
60290019 60292009 60299001 60310004 60311004 60333002 60370002 60370016 
     355      357      106      360      361       61       76      365 
60371103 60371201 60371302 60371602 60372005 60374002 60374004 60374008 
     906      482      723      118      120       55      239      574 
60374009 60374010 60376012 60379033 60379034 60392010 60410001 60410002 
     293      365      365      348       41      360      360      116 
60430003 60431001 60450006 60452003 60470003 60472510 60510001 60510005 
     224      350      350      351      359      360      111      358 
60519000 60530002 60530008 60531003 60570005 60571001 60590007 60592022 
     117      350      351      418      358      354      772      108 
60610003 60610004 60610006 60611004 60612003 60631006 60631007 60631010 
     354      358      349      356      357      332      289      485 
60650009 60650012 60650016 60650500 60651016 60652002 60655001 60658001 
     402      365      365      414      385      123      120      813 
60658005 60659000 60659001 60670006 60670010 60670012 60670015 60675003 
     778       64      365      703      446      696      359      352 
60690002 60690003 60710005 60710027 60710306 60711004 60712002 60718001 
     359      119      178      530      714      365      180      394 
60719002 60719004 60719010 60730001 60730077 60731006 60731008 60731014 
     119      118      117      102      362      356      357      360 
60731016 60731017 60731022 60731026 60731201 60750005 60771003 60772010 
     172      119      489      437      365      361      350      311 
60773005 60792004 60792007 60792020 60798002 60811001 60830011 60831009 
     355      360      359      359      349      356      351       86 
60832004 60832011 60839000 60850002 60850005 60850006 60870007 60871005 
     354      361       95      340      485      358      351      358 
60890004 60893003 60930005 60932001 60950004 60970004 60990005 60990006 
     373      107      112      312      720      348      404      341 
61010003 61030007 61050002 61059000 61070009 61071001 61072003 61072010 
     712      347      352       50      352      122      393      356 
61110007 61110009 61111004 61112002 61113001 61130004 61131003 
     356      361      360      714      361      322       59 
table(part2022$POC)

    1     2     3     4     5     8    11    12    21 
15948  1553 34668  2858   445   360   239    61     8 
summary(part2022$`Daily Mean PM2.5 Concentration`)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  -2.20    4.20    6.90    8.52   10.80  302.50 
table(part2022$`Daily Mean PM2.5 Concentration`)

 -2.2    -2  -1.9  -1.7  -1.5  -1.4  -1.3  -1.2  -1.1    -1  -0.9  -0.8  -0.7 
    1     1     2     1     1     6     5     4     4    11     4    12     8 
 -0.6  -0.5  -0.4  -0.3  -0.2  -0.1     0   0.1   0.2   0.3   0.4   0.5   0.6 
   17    17    23    25    32    33   111    49    85    93    81   147   130 
  0.7   0.8   0.9     1   1.1   1.2   1.3   1.4   1.5   1.6   1.7   1.8   1.9 
  165   159   146   250   167   247   197   208   297   266   304   285   291 
    2   2.1   2.2   2.3   2.4   2.5   2.6   2.7   2.8   2.9     3   3.1   3.2 
  455   326   372   338   355   450   361   481   372   390   568   439   554 
  3.3   3.4   3.5   3.6   3.7   3.8   3.9     4   4.1   4.2   4.3   4.4   4.5 
  450   429   563   493   530   461   447   676   462   585   478   469   583 
  4.6   4.7   4.8   4.9     5   5.1   5.2   5.3   5.4   5.5   5.6   5.7   5.8 
  507   630   467   460   685   457   597   441   463   598   474   578   480 
  5.9     6   6.1   6.2   6.3   6.4   6.5   6.6   6.7   6.8   6.9     7   7.1 
  413   641   427   553   447   447   546   429   540   443   377   529   406 
  7.2   7.3   7.4   7.5   7.6   7.7   7.8   7.9     8   8.1   8.2   8.3   8.4 
  502   385   387   491   400   479   336   359   475   345   454   368   317 
  8.5   8.6   8.7   8.8   8.9     9   9.1   9.2   9.3   9.4   9.5   9.6   9.7 
  438   351   432   352   348   389   316   388   356   329   371   308   380 
  9.8   9.9    10  10.1  10.2  10.3  10.4  10.5  10.6  10.7  10.8  10.9    11 
  282   276   368   271   329   275   266   313   259   290   220   252   291 
 11.1  11.2  11.3  11.4  11.5  11.6  11.7  11.8  11.9    12  12.1  12.2  12.3 
  256   292   227   202   274   199   239   217   189   238   186   236   197 
 12.4  12.5  12.6  12.7  12.8  12.9    13  13.1  13.2  13.3  13.4  13.5  13.6 
  174   197   165   200   149   171   210   151   224   169   156   173   129 
 13.7  13.8  13.9    14  14.1  14.2  14.3  14.4  14.5  14.6  14.7  14.8  14.9 
  171   109   137   160   130   135   140   119   115   114   128   133   121 
   15  15.1  15.2  15.3  15.4  15.5  15.6  15.7  15.8  15.9    16  16.1  16.2 
  141    99   109   101    96   126    98   126    89    91   114    84    76 
 16.3  16.4  16.5  16.6  16.7  16.8  16.9    17  17.1  17.2  17.3  17.4  17.5 
   79    78   106    75    88    76    71    93    63   101    70    70    71 
 17.6  17.7  17.8  17.9    18  18.1  18.2  18.3  18.4  18.5  18.6  18.7  18.8 
   66    73    54    40    84    40    61    43    40    56    55    65    41 
 18.9    19  19.1  19.2  19.3  19.4  19.5  19.6  19.7  19.8  19.9    20  20.1 
   53    51    35    50    30    38    45    37    32    31    28    49    25 
 20.2  20.3  20.4  20.5  20.6  20.7  20.8  20.9    21  21.1  21.2  21.3  21.4 
   41    39    29    52    34    36    27    31    42    31    35    35    27 
 21.5  21.6  21.7  21.8  21.9    22  22.1  22.2  22.3  22.4  22.5  22.6  22.7 
   22    30    41    28    23    28    38    39    18    23    31    23    30 
 22.8  22.9    23  23.1  23.2  23.3  23.4  23.5  23.6  23.7  23.8  23.9    24 
   28    18    24    16    29    21    21    20    20    21    11    19    22 
 24.1  24.2  24.3  24.4  24.5  24.6  24.7  24.8  24.9    25  25.1  25.2  25.3 
   22    15    15    15    16    18    17    15    15    12    17    24    21 
 25.4  25.5  25.6  25.7  25.8  25.9    26  26.1  26.2  26.3  26.4  26.5  26.6 
   19    21    15    17    11    16    10    12    14    22    16    15    16 
 26.7  26.8  26.9    27  27.1  27.2  27.3  27.4  27.5  27.6  27.7  27.8  27.9 
   18    15    13    19    15    11    11    16    19    14    12    11     9 
   28  28.1  28.2  28.3  28.4  28.5  28.6  28.7  28.8  28.9    29  29.1  29.2 
   14    14    10    12     9    18     9    13    12    11    11     9    17 
 29.3  29.4  29.5  29.6  29.7  29.8  29.9    30  30.1  30.2  30.3  30.4  30.5 
   11    10     9    12     8     9     6     5    15    10     5     7     7 
 30.6  30.7  30.8  30.9    31  31.1  31.2  31.3  31.4  31.5  31.6  31.7  31.8 
   11     8    11     9    16     5    12     8     4     9     9     9     9 
 31.9    32  32.1  32.2  32.3  32.4  32.5  32.6  32.7  32.8  32.9    33  33.1 
   11    11     4     4     8     3     7     5    10     7     8     6    13 
 33.2  33.3  33.4  33.5  33.6  33.7  33.8  33.9    34  34.1  34.2  34.3  34.4 
    7     6     5    17     5     5    11     4     5     7     4     3     6 
 34.5  34.6  34.7  34.8  34.9    35  35.1  35.2  35.3  35.4  35.5  35.6  35.7 
    6     8     5     5     6     8     4     7     3     2    11     3     3 
 35.8  35.9    36  36.1  36.2  36.3  36.4  36.5  36.6  36.7  36.8    37  37.1 
    2     9     8     4     9     4     4     6     2     3     5    10     5 
 37.2  37.3  37.4  37.5  37.6  37.7  37.8  37.9    38  38.1  38.2  38.3  38.4 
    2     5     3     4     5     3     4     3     5     5     5     1     4 
 38.5  38.6  38.7  38.8  38.9    39  39.1  39.2  39.3  39.4  39.5  39.6  39.7 
    5     3     3     6     1     4     5     4     4     3     8     3     5 
 39.8  39.9    40  40.1  40.2  40.3  40.4  40.5  40.6  40.7  40.8  40.9    41 
    5     1     3     4     2     2     1     4     4     7     7     2     2 
 41.1  41.2  41.3  41.4  41.5  41.6  41.7  41.8  41.9    42  42.1  42.2  42.3 
    1     5     1     2     3     3     2     4     2     3     3     4     2 
 42.4  42.5  42.6  42.7  42.8    43  43.1  43.2  43.3  43.4  43.5  43.6  43.7 
    2     1     1     4     1     2     5     4     2     3     5     1     4 
 43.8  43.9    44  44.1  44.2  44.3  44.4  44.5  44.8    45  45.2  45.4  45.5 
    2     1     5     2     2     1     1     3     2     1     1     1     1 
 45.7  45.9  46.1  46.2  46.3  46.6  46.7  46.8  46.9    47  47.1  47.4  47.5 
    2     1     3     4     3     1     4     1     1     1     1     1     1 
 47.8  47.9    48  48.2  48.3  48.5  48.6  48.7  48.9    49  49.1  49.2  49.4 
    1     1     2     1     1     1     1     3     1     3     1     1     1 
 49.7  49.8    50  50.2  50.5  50.8  51.2  51.4  51.5  51.8  51.9  52.2  52.5 
    1     1     2     1     2     1     2     1     1     1     1     1     1 
 52.6  52.8  52.9    53  53.2  53.3  53.5  53.6  53.8  53.9    54  54.5  54.6 
    2     1     3     1     1     1     1     1     1     2     1     1     2 
 54.7  55.6  55.8    56  56.3  57.8  58.1  58.6    59  59.3    60  61.5  62.3 
    3     1     1     1     1     1     1     2     2     1     1     1     1 
 62.4  62.5  62.8  62.9    63  63.7    64  64.2  64.4  66.2  66.6  66.7  68.6 
    1     1     1     1     1     1     2     1     1     2     1     1     1 
   69    70  70.7    73  73.5  73.8    74  75.3  75.5  76.3  77.2  77.5    78 
    1     1     1     3     2     1     1     2     1     1     1     1     1 
   81  83.5  83.6  84.4  84.5  85.2  88.6  89.2  89.8  90.7  91.4  92.4  96.6 
    1     1     1     1     1     1     1     1     1     1     1     1     1 
 97.2  98.2 101.4 102.3   103   105 106.4 107.2   108 108.8 109.5 110.2 111.1 
    1     1     1     1     1     1     1     1     1     1     1     1     1 
111.6 113.6 118.7   122 133.8 139.2 141.1 150.9 155.2 168.7 177.1 178.6 181.7 
    1     1     1     1     1     1     1     1     1     1     1     1     1 
212.8 218.2 243.9 244.7 246.2 296.3 302.5 
    1     1     1     1     1     1     1 
summary(part2022$DAILY_AQI_VALUE)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00   18.00   29.00   32.84   45.00  353.00 
table(part2022$DAILY_AQI_VALUE)

   0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
 367  178  228  454  396  611  505  570 1031  698 1143  842  762 1561  879 1586 
  16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31 
 908 1138 1532 1090 1557 1142 1038 1535 1058 1481 1000  993 1412  906 1293  878 
  32   33   34   35   36   37   38   39   40   41   42   43   44   45   46   47 
 879 1170  799 1123  783  700 1093  685 1059  558  639  870  572  762  547  519 
  48   49   50   51   52   53   54   55   56   57   58   59   60   61   62   63 
 675  456  427  619  885  756  798  671  616  494  530  504  414  328  375  317 
  64   65   66   67   68   69   70   71   72   73   74   75   76   77   78   79 
 240  214  204  173  183  149  174  148  146  107  115  103   89   81   59  100 
  80   81   82   83   84   85   86   87   88   89   90   91   92   93   94   95 
  66   83   65   72   60   63   45   58   44   42   37   50   40   38   25   41 
  96   97   98   99  100  101  102  103  104  105  106  107  108  109  110  111 
  38   31   23   28   12   17   23   23   10   22   15   17   15   13   17   19 
 112  113  114  115  116  117  118  119  120  121  122  123  124  125  126  127 
  13    9   20    9   10   16    6    7   14   12   10    5    3    2    3    8 
 128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143 
   4    7    2    2    4    3    8    2    2    3    2    1    4    2    1    3 
 144  145  146  147  148  151  152  153  154  155  156  157  158  159  160  161 
   5    3    4    1    6    4    2    6    1   10    1    4    3    1    6    4 
 162  163  164  165  166  168  169  170  172  173  175  176  177  178  179  180 
   3    1    1    1    4    2    2    2    1    2    2    1    2    2    3    2 
 181  184  185  191  194  195  201  206  219  227  229  232  263  268  294  296 
   1    1    1    1    1    1    1    1    1    1    1    1    1    1    2    1 
 346  353 
   1    1 
table(part2022$`Site Name`)

                                                  
                                              320 
                                         29 Palms 
                                              414 
                                           Alpine 
                                              356 
                                          Anaheim 
                                              772 
                            Aqua Tibia Wilderness 
                                               64 
                                Arroyo Grande CDF 
                                              359 
                                       Atascadero 
                                              349 
                                    Auburn-Atwood 
                                              354 
                                            Azusa 
                                               76 
                      Bakersfield-Airport (Planz) 
                                              114 
                           Bakersfield-California 
                                              712 
                        Bakersfield-Golden / M St 
                                              329 
                                  Banning Airport 
                                              365 
                                         Big Bear 
                                              394 
                                 Bishop Tribe EMO 
                                              352 
                          Brawley-220 Main Street 
                                              349 
                            Calexico-Ethel Street 
                                              448 
                                   Camp Pendleton 
                                              357 
                         Campo Indian Reservation 
                                              362 
                                    Carmel Valley 
                                              350 
                            Chester-222 First Ave 
                                              289 
                                Chico-East Avenue 
                                              410 
                                      Chula Vista 
                                              102 
                                     Clovis-Villa 
                                              359 
                                 Colfax-City Hall 
                                              358 
                              Colusa-Sunrise Blvd 
                                              359 
                                          Compton 
                                              723 
                                          Concord 
                                              463 
                               Corcoran-Patterson 
                                              360 
                         Cortina Indian Rancheria 
                                               42 
                Crescent City-Crescent Elk School 
                                              338 
                                        Crestline 
                                              178 
                                 Davis-UCD Campus 
                                              322 
                                          Donovan 
                                              360 
           El Cajon - Lexington Elementary School 
                                              489 
                             El Centro-9th Street 
                                              358 
                        El Rio-Rio Mesa School #2 
                                              361 
                                Folsom-Natoma St. 
                                              696 
                                          Fontana 
                                              180 
                                 Fresno - Garland 
                                              533 
                                   Fresno-Foundry 
                                              357 
                                   Fresno-Pacific 
                                              352 
                                           Gilroy 
                                              340 
                                         Glendora 
                                              365 
                                           Goleta 
                                              361 
                     Grass Valley-Litton Building 
                                              358 
                                    Hanford-Irwin 
                                              361 
                                        Hollister 
                                              359 
                                Hoover Wilderness 
                                              117 
                                            Huron 
                                              357 
                                            Indio 
                                              123 
                                           Jacobs 
                                              116 
                      Joshua Tree NP - Black Rock 
                                              119 
                                Kaiser Wilderness 
                                              112 
                                           Keeler 
                                              473 
                                      King City 2 
                                              351 
                                    Lake Elsinore 
                                              365 
                     Lake Tahoe Community College 
                                              111 
                          Lakeport-S. Main Street 
                                               61 
                        Lancaster-Division Street 
                                              348 
                                    Laney College 
                                              360 
 Lassen Volcanic NP - Manzanita Lake Fire Station 
                                              107 
                      Lava Beds National Monument 
                                              112 
                                            Lebec 
                                              398 
            Lebec-Peace Valley/Frazier Park Roads 
                                              106 
                                       Lee Vining 
                                              358 
                          Lincoln-2885 Moore Road 
                                              357 
                                        Livermore 
                                              343 
                                  Lompoc H Street 
                                              354 
            Lone Pine Paiute-Shoshone Reservation 
                                              302 
                               Long Beach (North) 
                                               55 
                               Long Beach (South) 
                                              239 
                   Long Beach-Route 710 Near Road 
                                              574 
                    Los Angeles-North Main Street 
                                              906 
                                      Madera-City 
                                              360 
                                          Mammoth 
                                              111 
                                          Manteca 
                                              311 
                                    Merced-Coffee 
                                              359 
                                      Merced-M St 
                                              360 
                                            Mesa2 
                                              360 
                            Mira Loma (Van Buren) 
                                              778 
                                    Mission Viejo 
                                              108 
                              Modesto-14th Street 
                                              404 
                          Mojave - CA 58 Business 
                                              355 
                   Morongo Air Monitoring Station 
                                              385 
                           North Hollywood (NOHO) 
                                              365 
                                          Oakland 
                                              365 
                                     Oakland West 
                                              364 
                             Ojai - East Ojai Ave 
                                              360 
                       Ontario-Route 60 Near Road 
                                              530 
                                      Pala Airpad 
                                              365 
                                     Palm Springs 
                                              120 
                               Paradise - Theater 
                                              354 
                                         Pasadena 
                                              120 
                                         Pechanga 
                                              402 
                                   Pico Rivera #2 
                                              118 
Pinnacles NP - Southwest of East Entrance Station 
                                              119 
                                   Piru - Pacific 
                                              361 
                            Pleasanton - Owens Ct 
                                              361 
                    Point Reyes NS Ranger Station 
                                              116 
                                      Porterville 
                                              356 
                                          Portola 
                                              485 
                           Quincy-N Church Street 
                                              332 
             Red Bluff-Walnut St. District Office 
                                              347 
                      Redding - Health Department 
                                              373 
                                     Redwood City 
                                              356 
                                       Redwood NP 
                                              120 
                                           Reseda 
                                              482 
                                  Ridgecrest-Ward 
                                              360 
                          Roseville-N Sunrise Ave 
                                              349 
                                         Rubidoux 
                                              813 
                         Sacramento-1309 T Street 
                                              446 
                          Sacramento-Bercut Drive 
                                              359 
                        Sacramento-Del Paso Manor 
                                              703 
                                        Salinas 3 
                                              418 
                     San Andreas-Gold Strike Road 
                                              355 
                                   San Bernardino 
                                              118 
                     San Diego - Kearny Villa Rd. 
                                              172 
            San Diego - Sherman Elementary School 
                                              437 
                   San Diego -Rancho Carmel Drive 
                                              119 
                                    San Francisco 
                                              361 
                               San Jose - Jackson 
                                              485 
                           San Jose - Knox Avenue 
                                              358 
                 San Lorenzo Valley Middle School 
                                              358 
                                        San Pablo 
                                              354 
                                       San Rafael 
                                              360 
                            San Rafael Wilderness 
                                               95 
                                    Santa Barbara 
                                              351 
                                    Santa Clarita 
                                              365 
                                       Santa Cruz 
                                              351 
                                       Sebastopol 
                                              348 
        Sequoia & Kings Canyon NPs - Ash Mountain 
                                              352 
                          Sequoia NP-Ash Mountain 
                                              122 
                               Signal Hill (LBSH) 
                                              293 
                       Simi Valley-Cochran Street 
                                              714 
                                      SLO Roberto 
                                              359 
                                      Sloughhouse 
                                              352 
                       Stn.1 Big Pine Paiute site 
                                              325 
                       Stockton - University Park 
                                              350 
               Table Mountain Air Monitoring Site 
                                              339 
                         Tahoe City-Fairway Drive 
                                              356 
                                         Temecula 
                                              365 
                                    Thousand Oaks 
                                              356 
                      Torres Martinez Reservation 
                                              235 
                                    Tracy-Airport 
                                              355 
                        TRAFFIC, RURAL PAVED ROAD 
                                              357 
                                     Tranquillity 
                                              352 
                                          Trinity 
                                               50 
                             Truckee-Fire Station 
                                              354 
                                          Turlock 
                                              341 
                                    Ukiah-Library 
                                              350 
                                           Upland 
                                              365 
                                          Vallejo 
                                              720 
                          Victorville-Park Avenue 
                                              714 
                        Visalia-W. Ashland Avenue 
                                              393 
                           Weaverville-Courthouse 
                                              352 
White Mountain Research Center - Owens Valley Lab 
                                              410 
                             Willits-Blosser Lane 
                                              351 
                            Willows-Colusa Street 
                                              351 
                             Woodland-Gibson Road 
                                               59 
                    Yosemite NP - Turtleback Dome 
                                              224 
       Yosemite NP-Yosemite Village Vistor Center 
                                              350 
                                            Yreka 
                                              312 
                                        Yuba City 
                                              712 
summary(part2022$DAILY_OBS_COUNT)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      1       1       1       1       1       1 

The 2022 dataset has 56140 observations and 20 variables. There are no NA’s and there was at least one value taken once per day throughout all of 2022 at one of the sites. There were no missed days. The data was collected from counties all across California. The median daily AQI value was 29.00 while the mean was 32.84. The daily median PM2.5 is 6.90 and the mean is 8.52. There are no NAs in this dataset.

Combining the Datatables

part2002$year <- "2002"
part2022$year <- "2022"
#creating new names for variables
part2002$PM2.5 <- part2002$`Daily Mean PM2.5 Concentration`
part2022$PM2.5 <- part2022$`Daily Mean PM2.5 Concentration`
part2002$lat <- part2002$SITE_LATITUDE
part2022$lat <- part2022$SITE_LATITUDE
part2002$lon <- part2002$SITE_LONGITUDE
part2022$lon <- part2022$SITE_LONGITUDE
#merging data
combo <- rbind(part2002, part2022)

Creating a basic map

year.pal <- colorFactor(c('turquoise','coral'), domain = combo$year)
leaflet(combo) %>% addProviderTiles('CartoDB.Positron') %>% addCircles(lat=~combo$lat, lng=~combo$lon,  label = ~paste0(round(combo$PM2.5,10)), opacity=1, fillOpacity = 1, radius = 100, color = ~ year.pal(combo$year)) %>%
  addLegend('bottomleft', pal=year.pal, value=combo$year,
          title='Year', opacity=1)

There are a lot more locations in 2022 then there are in 2002. There are very few sites near the border between California and Arizona. In 2002 the distribution is more focused on the border of California and a couple spots in central California. In 2022 there are many more sites throughout the state with higher concentrations around Sacramento, the bay area, LA, and San Diego.

Checking PM2.5

table(is.na(combo$PM2.5))

FALSE 
72116 
boxplot(combo$PM2.5)

barplot(combo$PM2.5)

hist(combo$PM2.5)

There is no missing data in PM2.5.

Main Question

#state
combo$datenum<- as.Date.character(combo$Date)
combo %>% 
  ggplot() + 
  geom_boxplot(mapping = aes(x = 1, y = combo$PM2.5, color = combo$year)) + facet_wrap(~ year, nrow=1)

summary(part2002$PM2.5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00    7.00   12.00   16.12   20.50  104.30 
summary(part2022$PM2.5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  -2.20    4.20    6.90    8.52   10.80  302.50 
combo %>% 
  ggplot() + 
  geom_histogram(mapping = aes(x = PM2.5, color = combo$year, fill = combo$year), alpha=0.5, position="dodge")
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

combo %>%
  ggplot() +
  geom_line(mapping = aes(x = datenum, y = combo$PM2.5, group = year, color = year))
Warning: Removed 43714 rows containing missing values (`geom_line()`).

#county
combo[combo$COUNTY == "Alameda"] %>% 
  ggplot() + 
  geom_boxplot(mapping = aes(x = 1, y = PM2.5, color = year)) + facet_wrap(~ year, nrow=1)

combo[combo$COUNTY == "Alameda"] %>% 
  ggplot() + 
  geom_histogram(mapping = aes(x = PM2.5, color = year, fill = year), alpha=0.5, position="identity")
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

alameda02 <- subset(part2002, COUNTY = "Alameda")
summary(alameda02$PM2.5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00    7.00   12.00   16.12   20.50  104.30 
alameda22 <- subset(part2022, COUNTY = "Alameda")
summary(alameda22$PM2.5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  -2.20    4.20    6.90    8.52   10.80  302.50 
combo[combo$COUNTY == "Alameda"] %>%
  ggplot() +
  geom_line(mapping = aes(x = datenum, y = PM2.5, group = year, color = year))
Warning: Removed 1204 rows containing missing values (`geom_line()`).

#LA Site
combo[combo$`Site Name` == "Los Angeles-North Main Street"] %>% 
  ggplot() + 
  geom_boxplot(mapping = aes(x = 1, y = PM2.5, color = year)) + facet_wrap(~ year, nrow=1)

combo[combo$`Site Name` == "Los Angeles-North Main Street"] %>%
  ggplot() + 
  geom_histogram(mapping = aes(x = PM2.5, color = year, fill = year), alpha=0.5, position="identity")
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

LA02 <- subset(part2002, 'Site Name' = "Los Angeles-North Main Street")
summary(LA02$PM2.5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00    7.00   12.00   16.12   20.50  104.30 
LA22 <- subset(part2022, 'Site Name' = "Los Angeles-North Main Street")
summary(LA22$PM2.5)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  -2.20    4.20    6.90    8.52   10.80  302.50 
combo[combo$`Site Name` == "Los Angeles-North Main Street"] %>%
  ggplot() +
  geom_line(mapping = aes(x = datenum, y = PM2.5, group = year, color = year))
Warning: Removed 769 rows containing missing values (`geom_line()`).

State

Overall for the state data the the median 75th quarrile for 2022 is all much lower than the particulate matter 2.5 in 2002. However there are a lot more outliers in 2022 than there are in 2002 and the outliers are much higher than they are in 2002. There is a period of time in september to october of 2022 that the particulate matter across California is really high, this is probably due to a wildfire that occurred in California during that time. Due to the outliers the data from 2022 seems to be worsening particulate matter due to just how much higher the bad days are than in 2002 but overall has better air quality.

County

When looking at the data from just Alameda county it is clear that overall the air quality is better in 2022 than it was in 2002. There are far higher outliers in 2002 than there are in 2022. Also the medians and means of particulate matter are lower in 2022 than in 2002.

LA Site

When looking at the data from just the LA Site as Los Angeles-North Main Street it is clear that the air quality is better in 2022 than it is in 2002. When looking at the line plot almost every day in 2002 had a higher particulate matter amount than in 2022.